#ifndef NR_DEVICE_TYPE_PROPERTY_H
#define NR_DEVICE_TYPE_PROPERTY_H

#include "nr_std.h"
#include "nr_object.h"

class nr_device_type_property : public nr_object
{
public:
    enum property_type_t
    {
        Invalid = 0,
        Property,
        PropertyGroup,
        PropertyEnum,
        PropertyEnumItem,
        Parameter,
        Event,
        EventCategory,
    };
    
public:
    nr_device_type_property();
    ~nr_device_type_property();
    
    static property_type_t parse_property_type(const QString &type_str);
    QString toString_property_type();
    QString toString_value_type();

    property_type_t& property_type() { return m_propery_type; }
    nr_object::value_type_t& value_type() { return m_value_type; }

    nr_id_t& id() { return m_id; }
    QString& name() { return m_name; }
    QString& text() { return m_text; }
    QString& category() { return m_category; }
    QString& description() { return m_description; }
    QVariant& value() { return m_value; }
    QVariant& default_value() { return m_default_value; }
    QString& extra_data() { return m_extra_data; }
    
    typedef QHash<nr_id_t, nr_device_type_property*> nr_device_type_property_hash;

    nr_device_type_property_hash &children() { return m_child_properties; }
    
protected:
    nr_device_type_property::property_type_t m_propery_type;
    nr_object::value_type_t m_value_type;
    nr_id_t m_id;
    QString m_name, m_text, m_category, m_description, m_extra_data;
    QVariant m_value, m_default_value;
    nr_device_type_property_hash m_child_properties;
};

typedef nr_device_type_property nr_device_type_parameter;

typedef nr_device_type_property::nr_device_type_property_hash nr_device_type_properties;

typedef QHash<nr_id_t, nr_device_type_parameter*> nr_device_type_parameters;

typedef nr_device_type_property nr_device_type_event;

typedef QHash<nr_id_t, nr_device_type_event*> nr_device_type_events;

#endif // NR_DEVICE_PROPERTY_H
